<script lang="ts" setup>
import { onMounted } from "vue";
import {emitter} from "../core/eventBus";

import { useCounterStore } from "../store/index";
const counter = useCounterStore();
const obj = {};
console.log(obj.toString());
console.log(Object.getPrototypeOf(obj));
onMounted(() => {});
const sendMessage = () => {
  emitter.emit("message", "Hello from Component A!");
};
let virtualDom = {
  tag: "div",
  attrs: {
    class: "slider",
    id: "slider",
  },
  text: "关于我们",
  children: [],
};

let div = document.createElement('div')
let str = ''
for (const key in div) {
  str += key + ''
}
// console.log(str)
function Animal(name:string) {
   let _name_ = name;
}
console.log(Animal.prototype);
// Animal.prototype.constructor 指向 Animal 函数本身
console.log(Animal.prototype.constructor === Animal); // true
Animal.prototype.say = function() {console.log('Animal say')}

console.log(Animal.prototype);
console.log(Animal);
</script>
<template>
  <div>我是Slider组件</div>
  <button @click="sendMessage">发送消息</button>
  <div class="line"></div>
  <div>{{ counter.count }}</div>
</template>
<style scoped>
.line {
  width: 100%;
  height: 1px;
  background: #333;
  transform: scaleY(0.5);
}
</style>
